import requests
from config import url, headers_web


class GroupMembersResource:

    def __init__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_class_group_members(cls, url_path: str, params=None, headers=headers_web, parampath=None):
        """
        @Summary:获取班级成员信息
        @Description:云课堂前端使用
        :param url:
        :param params:{userNoOrName:学号/工号或者姓名,validCode:验证码：groupId=?&signKey=123123(md5加密)}
        :param headers:
        :param parampath:groupId:组Id
        :return:
        """
        url_path = url_path + "/courseApi/v1/groupmembers/{}".format(parampath)
        r = requests.post(url=url_path, headers=headers, params=params)
        return r
